import {
	userStore
} from '../stores/userInfo/userInfo.js'
import {
	getToken,
	getTokenExpired
} from '../utils/localStoreToken.js'
const init = async () => {
	let token = getToken()
	let tokenExpired = getTokenExpired()
	// return new Promise(async(resolve, reject ) => {
	let date = Date.now()
	if (token && date <= tokenExpired) {
		let user = userStore()
		try {
			let res = await user.getUserInfo({
				token
			})
			return 'ok'
		} catch (err) {
			return 'ok'
		}
	} else {
	
		return 'ok'
	}
	// })
}
export default async function () {
	return await init()
}
